const getters = {
  token: state => state.user.token,
  toolFileReset: state => state.pageAction.toolFileReset,
  nickname: state => state.user.name,
  loginCode: state => state.user.loginCode,
  userId: state => state.user.userId,
  extendS1: state => state.user.extendS1,
  extendS2: state => state.user.extendS2,
  permissionTags: state => state.user.permissionTags,
  addRouters: state => state.user.addRouters,
  dictTypeList: state => state.app.dictTypeList, // 字典列表
  rightDrawerOPen: state => state.app.rightDrawerOPen,
  rightDrawerLoading: state => state.app.rightDrawerLoading,
  rightSubmitDisabled: state => state.app.rightSubmitDisabled,
  newDataCache: state => state.app.newDataCache,
  // 当前用户当前项目id
  myActiveProjectId: state => state.user.myActiveProjectId,
  modelVisible: state => state.app.modelVisible,
  drawerOpenTime: state => state.app.drawerConfig.createdTime,
  locale: state => {
    // 国际化切换
    // 如果值locale为空且缓存有值，用缓存的值
    if (!state.app.locale && localStorage.getItem('pro__locale')) {
      return JSON.parse(localStorage.getItem('pro__locale')).value
    }
    return state.app.locale || 'zhCN' // 如果值为空且缓存没有值则默认中文
  }
}
export default getters
